package vn.gameloft.egg.model;

import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

public class GameObject {

    public float x;
    public float y;

    private Texture image;
    public float scale = 1.0f;

    public GameObject() {
    }

    public GameObject(FileHandle image) {
        this.image = new Texture(image);
    }

    public void setImage(FileHandle image) {
        this.image = new Texture(image);
    }

    public int getWidth() {
        return (int) (image.getWidth() * scale);
    }

    public int getHeight() {
        return (int) (image.getHeight() * scale);
    }

    public void draw(SpriteBatch batch) {
        batch.draw(image, this.x, this.y, this.getWidth(), this.getHeight());
    }
}
